package com.haochang.chunkvod.view.vod.dialog;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * @author qintao
 *         created at 2016/7/22 12:55
 *         DialogItemInfo继承BaseDialogItemInfo 可获得更多属性
 */

public class DialogItemInfo extends BaseDialogItemInfo implements Parcelable
{
	private String code;
	private String name;
	private boolean isSelected = false;

	protected DialogItemInfo(Parcel in)
	{
		code = in.readString();
		name = in.readString();
		isSelected = in.readByte() != 0;
	}

	public static final Creator<DialogItemInfo> CREATOR = new Creator<DialogItemInfo>()
	{
		@Override
		public DialogItemInfo createFromParcel(Parcel in)
		{
			return new DialogItemInfo(in);
		}

		@Override
		public DialogItemInfo[] newArray(int size)
		{
			return new DialogItemInfo[size];
		}
	};

	public String getCode()
	{
		return code;
	}

	public void setCode(String code)
	{
		this.code = code;
	}

	public String getName()
	{
		return name;
	}

	public void setName(String name)
	{
		this.name = name;
	}

	public boolean isSelected()
	{
		return isSelected;
	}

	public void setSelected(boolean selected)
	{
		isSelected = selected;
	}

	public DialogItemInfo(String code, String name, boolean isSelected)
	{
		this.code = code;
		this.name = name;
		this.isSelected = isSelected;
	}

	public DialogItemInfo(String name, boolean isSelected)
	{
		this.name = name;
		this.isSelected = isSelected;
	}

	public DialogItemInfo()
	{
	}

	@Override
	public int describeContents()
	{
		return 0;
	}

	@Override
	public void writeToParcel(Parcel dest, int flags)
	{
		dest.writeString(code);
		dest.writeString(name);
		dest.writeByte((byte) (isSelected ? 1 : 0));
	}
}
